<?php 
class AppraiseModel extends Model{
	private $table1 = 'appraise';
	private $table2 = 'appraiseavg';
	/**
	 * 获取会员平均积分
	 */
	public function getAverage($uid){
		/* $acount = M($this->table1)->where(array('uid'=>$uid))->count();
		//echo $acount;die;
		if($acount){
			$allpoint = M($this->table1)->where(array('uid'=>$uid))->sum('point');		
			$point = $allpoint/($acount*5)*5;
		}else{
			$point =0;
		} */
		$point = M($this->table2)->where(array('uid'=>$uid))->field('aavg')->find();
		return $point['aavg'];
	}
}
?>